<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libcoap: block.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">libcoap<span id="projectnumber">&#160;4.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('block_8c.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">block.c File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;coap_config.h&quot;</code><br />
<code>#include &quot;<a class="el" href="libcoap_8h_source.html">libcoap.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="coap__debug_8h_source.html">coap_debug.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="block_8h_source.html">block.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="resource_8h_source.html">resource.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="coap__hashkey_8h_source.html">coap_hashkey.h</a>&quot;</code><br />
</div>
<p><a href="block_8c_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ac6afabdc09a49a433ee19d8a9486056d" id="r_ac6afabdc09a49a433ee19d8a9486056d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="block_8c.html#ac6afabdc09a49a433ee19d8a9486056d">min</a>(a,  b)&#160;&#160;&#160;((a) &lt; (b) ? (a) : (b))</td></tr>
<tr class="separator:ac6afabdc09a49a433ee19d8a9486056d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gaac6c90297abc6e2da80a6212b0d10e99" id="r_gaac6c90297abc6e2da80a6212b0d10e99"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__block.html#gaac6c90297abc6e2da80a6212b0d10e99">coap_opt_block_num</a> (const <a class="el" href="option_8h.html#a963ad4994625360a5ac70d9df2ab5412">coap_opt_t</a> *block_opt)</td></tr>
<tr class="memdesc:gaac6c90297abc6e2da80a6212b0d10e99"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the value of field <code>num</code> in the given block option <code>block_opt</code>.  <br /></td></tr>
<tr class="separator:gaac6c90297abc6e2da80a6212b0d10e99"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga714d943bd85123de1b8b6f86ec204a69" id="r_ga714d943bd85123de1b8b6f86ec204a69"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__block.html#ga714d943bd85123de1b8b6f86ec204a69">coap_get_block</a> (<a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *pdu, uint16_t type, <a class="el" href="structcoap__block__t.html">coap_block_t</a> *block)</td></tr>
<tr class="memdesc:ga714d943bd85123de1b8b6f86ec204a69"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes <code>block</code> from <code>pdu</code>.  <br /></td></tr>
<tr class="separator:ga714d943bd85123de1b8b6f86ec204a69"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0462e5c93460d2df1c60611188192524" id="r_ga0462e5c93460d2df1c60611188192524"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__block.html#ga0462e5c93460d2df1c60611188192524">coap_write_block_opt</a> (<a class="el" href="structcoap__block__t.html">coap_block_t</a> *block, uint16_t type, <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *pdu, size_t data_length)</td></tr>
<tr class="memdesc:ga0462e5c93460d2df1c60611188192524"><td class="mdescLeft">&#160;</td><td class="mdescRight">Writes a block option of type <code>type</code> to message <code>pdu</code>.  <br /></td></tr>
<tr class="separator:ga0462e5c93460d2df1c60611188192524"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0a90438f60d08abd88da955ec895cedb" id="r_ga0a90438f60d08abd88da955ec895cedb"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__block.html#ga0a90438f60d08abd88da955ec895cedb">coap_add_block</a> (<a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *pdu, unsigned int len, const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *data, unsigned int block_num, unsigned char block_szx)</td></tr>
<tr class="memdesc:ga0a90438f60d08abd88da955ec895cedb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds the <code>block_num</code> block of size 1 &lt;&lt; (<code>block_szx</code> + 4) from source <code>data</code> to <code>pdu</code>.  <br /></td></tr>
<tr class="separator:ga0a90438f60d08abd88da955ec895cedb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga38c1e9829062e3e2ce621641f1ae59c5" id="r_ga38c1e9829062e3e2ce621641f1ae59c5"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__block.html#ga38c1e9829062e3e2ce621641f1ae59c5">coap_add_data_blocked_response</a> (<a class="el" href="structcoap__resource__t.html">coap_resource_t</a> *resource, <a class="el" href="structcoap__session__t.html">coap_session_t</a> *session, <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *request, <a class="el" href="structcoap__pdu__t.html">coap_pdu_t</a> *response, const <a class="el" href="structcoap__binary__t.html">coap_binary_t</a> *token, uint16_t media_type, int maxage, size_t length, const <a class="el" href="uthash_8h.html#aba7bc1797add20fe3efdf37ced1182c5">uint8_t</a> *data)</td></tr>
<tr class="memdesc:ga38c1e9829062e3e2ce621641f1ae59c5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Adds the appropriate part of <code>data</code> to the <code>response</code> pdu.  <br /></td></tr>
<tr class="separator:ga38c1e9829062e3e2ce621641f1ae59c5"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ac6afabdc09a49a433ee19d8a9486056d" name="ac6afabdc09a49a433ee19d8a9486056d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac6afabdc09a49a433ee19d8a9486056d">&#9670;&#160;</a></span>min</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define min</td>
          <td>(</td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">a, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">&#160;</td>
          <td class="paramname">b&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td>&#160;&#160;&#160;((a) &lt; (b) ? (a) : (b))</td>
        </tr>
      </table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="block_8c_source.html#l00022">22</a> of file <a class="el" href="block_8c_source.html">block.c</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="block_8c.html">block.c</a></li>
    <li class="footer">Generated on Fri Dec 27 2024 09:57:44 for libcoap by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8 </li>
  </ul>
</div>
</body>
</html>
